export const readCodebookValue = function (codebook, expGolomb) {
  let bitString = expGolomb.bitReservoir;

  for(let i = 0; i < codebook.length; i++) {
    let o = codebook[i];
    let subString = bitString.slice(0, o.size);
    let index = o[subString];

    if (typeof index === 'number') {
      expGolomb.readBits(o.size);
      return index;
    }
  }
  return -999999;
  //expGolomb.bitStream = '';
};

export const scaleFactorCB = [
  {
    "0": 60,
    "size": 1
  },
  {
    "100": 59,
    "size": 3
  },
  {
    "1010": 61,
    "1011": 58,
    "1100": 62,
    "size": 4
  },
  {
    "11010": 57,
    "11011": 63,
    "size": 5
  },
  {
    "111000": 56,
    "111001": 64,
    "111010": 55,
    "111011": 65,
    "size": 6
  },
  {
    "1111000": 66,
    "1111001": 54,
    "1111010": 67,
    "size": 7
  },
  {
    "11110110": 53,
    "11110111": 68,
    "11111000": 52,
    "11111001": 69,
    "11111010": 51,
    "size": 8
  },
  {
    "111110110": 70,
    "111110111": 50,
    "111111000": 49,
    "111111001": 71,
    "size": 9
  },
  {
    "1111110100": 72,
    "1111110101": 48,
    "1111110110": 73,
    "1111110111": 47,
    "1111111000": 74,
    "1111111001": 46,
    "size": 10
  },
  {
    "size": 11,
    "11111110101": 75,
    "11111110100": 76,
    "11111111001": 43,
    "11111111000": 45,
    "11111110110": 77,
    "11111110111": 78
  },
  {
    "size": 12,
    "111111110100": 44,
    "111111110111": 41,
    "111111110110": 42,
    "111111111001": 40,
    "111111110101": 79,
    "111111111000": 80
  },
  {
    "size": 13,
    "1111111110100": 81,
    "1111111110110": 82,
    "1111111110111": 38,
    "1111111110101": 39,
    "1111111111000": 83
  },
  {
    "size": 14,
    "11111111110010": 37,
    "11111111110111": 34,
    "11111111110110": 36,
    "11111111110101": 33,
    "11111111111001": 32,
    "11111111111000": 84,
    "11111111110100": 85,
    "11111111110011": 35
  },
  {
    "size": 15,
    "111111111110110": 30,
    "111111111110100": 87,
    "111111111110111": 31,
    "111111111110101": 89
  },
  {
    "size": 16,
    "1111111111110011": 27,
    "1111111111110100": 28,
    "1111111111110001": 29,
    "1111111111110010": 26,
    "1111111111110101": 24,
    "1111111111110110": 88,
    "1111111111110000": 86
  },
  {
    "size": 17,
    "11111111111110000": 23,
    "11111111111101110": 25,
    "11111111111101111": 22
  },
  {
    "size": 18,
    "111111111111100111": 2,
    "111111111111100100": 19,
    "111111111111100101": 3,
    "111111111111100011": 21,
    "111111111111100010": 90,
    "111111111111101000": 0,
    "111111111111100110": 1
  },
  {
    "size": 19,
    "1111111111111010010": 98,
    "1111111111111111010": 20,
    "1111111111111111011": 17,
    "1111111111111111000": 16,
    "1111111111111110111": 15,
    "1111111111111111110": 14,
    "1111111111111111111": 13,
    "1111111111111111101": 12,
    "1111111111111111100": 11,
    "1111111111111110000": 10,
    "1111111111111101111": 9,
    "1111111111111101110": 8,
    "1111111111111110110": 7,
    "1111111111111101101": 6,
    "1111111111111110001": 5,
    "1111111111111110101": 4,
    "1111111111111011001": 91,
    "1111111111111011010": 92,
    "1111111111111011011": 93,
    "1111111111111011100": 94,
    "1111111111111011101": 95,
    "1111111111111011110": 96,
    "1111111111111011000": 97,
    "1111111111111111001": 18,
    "1111111111111010011": 99,
    "1111111111111010100": 100,
    "1111111111111010101": 101,
    "1111111111111010110": 102,
    "1111111111111110010": 103,
    "1111111111111011111": 104,
    "1111111111111100111": 105,
    "1111111111111101000": 106,
    "1111111111111101001": 107,
    "1111111111111101010": 108,
    "1111111111111101011": 109,
    "1111111111111100110": 110,
    "1111111111111100000": 111,
    "1111111111111100001": 112,
    "1111111111111100010": 113,
    "1111111111111100011": 114,
    "1111111111111100100": 115,
    "1111111111111100101": 116,
    "1111111111111010111": 117,
    "1111111111111101100": 118,
    "1111111111111110100": 119,
    "1111111111111110011": 120
  }
];

export const spectrumCB = [
  [],
  [
    {
      "0": 40,
      "size": 1
    },
    {
      "10000": 67,
      "10001": 13,
      "10010": 39,
      "10011": 49,
      "10100": 41,
      "10101": 37,
      "10110": 43,
      "10111": 31,
      "size": 5
    },
    {
      "1100000": 58,
      "1100001": 22,
      "1100010": 38,
      "1100011": 46,
      "1100100": 34,
      "1100101": 42,
      "1100110": 76,
      "1100111": 36,
      "1101000": 4,
      "1101001": 28,
      "1101010": 64,
      "1101011": 48,
      "1101100": 16,
      "1101101": 44,
      "1101110": 70,
      "1101111": 32,
      "1110000": 52,
      "1110001": 50,
      "1110010": 10,
      "1110011": 68,
      "1110100": 12,
      "1110101": 66,
      "1110110": 14,
      "1110111": 30,
      "size": 7
    },
    {
      "111100000": 73,
      "111100001": 19,
      "111100010": 61,
      "111100011": 51,
      "111100100": 47,
      "111100101": 35,
      "111100110": 33,
      "111100111": 55,
      "111101000": 65,
      "111101001": 45,
      "111101010": 25,
      "111101011": 15,
      "111101100": 7,
      "111101101": 29,
      "111101110": 59,
      "111101111": 57,
      "111110000": 21,
      "111110001": 1,
      "111110010": 27,
      "111110011": 53,
      "111110100": 69,
      "111110101": 77,
      "111110110": 23,
      "111110111": 79,
      "size": 9
    },
    {
      "1111110000": 5,
      "1111110001": 9,
      "1111110010": 75,
      "1111110011": 63,
      "1111110100": 11,
      "1111110101": 3,
      "1111110110": 17,
      "1111110111": 71,
      "size": 10
    },
    {
      "size": 11,
      "11111111101": 2,
      "11111111110": 54,
      "11111110101": 8,
      "11111110011": 56,
      "11111111000": 0,
      "11111110010": 24,
      "11111111100": 18,
      "11111110110": 72,
      "11111110000": 60,
      "11111111001": 74,
      "11111111011": 26,
      "11111111010": 62,
      "11111110111": 6,
      "11111111111": 78,
      "11111110001": 20,
      "11111110100": 80
    }
  ],
  [
    {
      "size": 3,
      "000": 40
    },
    {
      "size": 4,
      "0010": 67
    },
    {
      "size": 5,
      "00110": 13,
      "01010": 31,
      "01000": 37,
      "01001": 39,
      "00111": 41,
      "01011": 43,
      "01100": 49
    },
    {
      "100000": 12,
      "100001": 58,
      "100010": 64,
      "100011": 4,
      "100100": 36,
      "100101": 70,
      "100110": 68,
      "100111": 32,
      "101000": 16,
      "101001": 50,
      "101010": 28,
      "101011": 14,
      "101100": 30,
      "101101": 10,
      "101110": 76,
      "101111": 52,
      "110000": 44,
      "110001": 66,
      "size": 6,
      "011011": 22,
      "011010": 34,
      "011111": 38,
      "011101": 42,
      "011100": 46,
      "011110": 48
    },
    {
      "1100100": 47,
      "1100101": 65,
      "1100110": 19,
      "1100111": 33,
      "1101000": 61,
      "1101001": 75,
      "1101010": 71,
      "1101011": 25,
      "1101100": 29,
      "1101101": 79,
      "1101110": 15,
      "1101111": 1,
      "1110000": 11,
      "1110001": 55,
      "1110010": 73,
      "size": 7
    },
    {
      "11100110": 59,
      "11100111": 21,
      "11101000": 7,
      "11101001": 17,
      "11101010": 5,
      "11101011": 3,
      "11101100": 27,
      "11101101": 69,
      "11101110": 63,
      "11101111": 45,
      "11110000": 53,
      "11110001": 23,
      "11110010": 9,
      "11110011": 51,
      "11110100": 57,
      "11110101": 35,
      "11110110": 77,
      "11110111": 60,
      "11111000": 20,
      "size": 8
    },
    {
      "111110010": 56,
      "111110011": 0,
      "111110100": 24,
      "111110101": 26,
      "111110110": 80,
      "111110111": 6,
      "111111000": 62,
      "111111001": 18,
      "111111010": 8,
      "111111011": 72,
      "111111100": 54,
      "111111101": 2,
      "111111110": 74,
      "111111111": 78,
      "size": 9
    }
  ],
  [
    {
      "0": 0,
      "size": 1
    },
    {
      "1000": 27,
      "1001": 1,
      "1010": 9,
      "1011": 3,
      "size": 4
    },
    {
      "11000": 36,
      "11001": 4,
      "size": 5
    },
    {
      "110100": 12,
      "110101": 10,
      "110110": 30,
      "110111": 13,
      "111000": 28,
      "111001": 39,
      "size": 6
    },
    {
      "1110100": 40,
      "1110101": 31,
      "1110110": 37,
      "size": 7
    },
    {
      "11101110": 54,
      "11101111": 2,
      "11110000": 5,
      "11110001": 63,
      "11110010": 48,
      "size": 8
    },
    {
      "111100110": 7,
      "111100111": 16,
      "111101000": 45,
      "111101001": 14,
      "111101010": 66,
      "111101011": 6,
      "111101100": 21,
      "111101101": 15,
      "111101110": 18,
      "111101111": 11,
      "111110000": 57,
      "111110001": 49,
      "111110010": 22,
      "111110011": 42,
      "111110100": 43,
      "size": 9
    },
    {
      "1111101010": 46,
      "1111101011": 33,
      "1111101100": 34,
      "1111101101": 19,
      "1111101110": 67,
      "1111101111": 41,
      "1111110000": 64,
      "1111110001": 32,
      "1111110010": 8,
      "1111110011": 17,
      "1111110100": 75,
      "1111110101": 51,
      "1111110110": 29,
      "1111110111": 55,
      "1111111000": 25,
      "size": 10
    },
    {
      "size": 11,
      "11111111001": 23,
      "11111111000": 24,
      "11111110111": 76,
      "11111110011": 52,
      "11111110010": 72,
      "11111110100": 38,
      "11111110110": 44,
      "11111110101": 58
    },
    {
      "size": 12,
      "111111111100": 53,
      "111111110100": 35,
      "111111110101": 73,
      "111111111011": 50,
      "111111111010": 70,
      "111111110111": 78,
      "111111110110": 69,
      "111111111001": 79,
      "111111111000": 26
    },
    {
      "size": 13,
      "1111111111010": 20,
      "1111111111100": 47,
      "1111111111011": 60
    },
    {
      "size": 14,
      "11111111111011": 68,
      "11111111111010": 61,
      "11111111111100": 65
    },
    {
      "size": 15,
      "111111111111010": 80,
      "111111111111100": 71,
      "111111111111101": 59,
      "111111111111011": 77,
      "111111111111110": 56
    },
    {
      "size": 16,
      "1111111111111111": 62,
      "1111111111111110": 74
    }
  ],
  [
    {
      "1000": 4,
      "1001": 30,
      "size": 4,
      "0000": 40,
      "0111": 0,
      "0011": 39,
      "0010": 37,
      "0110": 36,
      "0100": 31,
      "0101": 27,
      "0001": 13
    },
    {
      "10100": 28,
      "10101": 12,
      "10110": 1,
      "10111": 10,
      "11000": 3,
      "11001": 9,
      "size": 5
    },
    {
      "1101000": 67,
      "1101001": 43,
      "1101010": 49,
      "1101011": 41,
      "1101100": 66,
      "1101101": 64,
      "1101110": 48,
      "1101111": 58,
      "1110000": 16,
      "size": 7
    },
    {
      "11100010": 14,
      "11100011": 42,
      "11100100": 22,
      "11100101": 32,
      "11100110": 46,
      "11100111": 38,
      "11101000": 34,
      "11101001": 63,
      "11101010": 57,
      "11101011": 45,
      "11101100": 55,
      "11101101": 11,
      "11101110": 21,
      "11101111": 5,
      "11110000": 15,
      "11110001": 19,
      "11110010": 29,
      "11110011": 7,
      "11110100": 33,
      "11110101": 54,
      "11110110": 2,
      "size": 8
    },
    {
      "111101110": 18,
      "111101111": 6,
      "111110000": 52,
      "111110001": 76,
      "111110010": 70,
      "111110011": 44,
      "111110100": 50,
      "111110101": 68,
      "size": 9
    },
    {
      "1111101100": 51,
      "1111101101": 75,
      "1111101110": 69,
      "1111101111": 25,
      "1111110000": 17,
      "1111110001": 73,
      "1111110010": 23,
      "1111110011": 61,
      "1111110100": 35,
      "1111110101": 79,
      "1111110110": 47,
      "1111110111": 59,
      "1111111000": 65,
      "1111111001": 53,
      "size": 10
    },
    {
      "size": 11,
      "11111111010": 20,
      "11111111100": 80,
      "11111111001": 60,
      "11111110100": 71,
      "11111110111": 72,
      "11111110110": 24,
      "11111111000": 8,
      "11111111011": 56,
      "11111111101": 26,
      "11111110101": 77,
      "11111111110": 78
    },
    {
      "size": 12,
      "111111111111": 62,
      "111111111110": 74
    }
  ],
  [
    {
      "0": 40,
      "size": 1
    },
    {
      "1000": 31,
      "1001": 49,
      "1010": 41,
      "1011": 39,
      "size": 4
    },
    {
      "11000": 48,
      "11001": 32,
      "11010": 30,
      "11011": 50,
      "size": 5
    },
    {
      "1110000": 22,
      "1110001": 42,
      "1110010": 58,
      "1110011": 38,
      "size": 7
    },
    {
      "11101000": 21,
      "11101001": 59,
      "11101010": 29,
      "11101011": 51,
      "11101100": 23,
      "11101101": 57,
      "11101110": 33,
      "11101111": 47,
      "11110000": 13,
      "11110001": 67,
      "11110010": 37,
      "11110011": 43,
      "size": 8
    },
    {
      "111101000": 12,
      "111101001": 52,
      "111101010": 68,
      "111101011": 28,
      "111101100": 14,
      "111101101": 66,
      "111101110": 46,
      "111101111": 34,
      "111110000": 24,
      "111110001": 60,
      "111110010": 20,
      "111110011": 56,
      "size": 9
    },
    {
      "1111101000": 11,
      "1111101001": 65,
      "1111101010": 25,
      "1111101011": 55,
      "1111101100": 69,
      "1111101101": 61,
      "1111101110": 15,
      "1111101111": 19,
      "1111110000": 36,
      "1111110001": 4,
      "1111110010": 77,
      "1111110011": 76,
      "size": 10
    },
    {
      "size": 11,
      "11111101011": 27,
      "11111101001": 44,
      "11111101111": 45,
      "11111101101": 35,
      "11111110001": 10,
      "11111110101": 78,
      "11111110111": 62,
      "11111110000": 64,
      "11111110010": 16,
      "11111101110": 5,
      "11111101000": 3,
      "11111111001": 6,
      "11111101100": 53,
      "11111111000": 70,
      "11111101010": 75,
      "11111110110": 54,
      "11111110011": 26,
      "11111110100": 2
    },
    {
      "size": 12,
      "111111110110": 63,
      "111111110100": 18,
      "111111111001": 71,
      "111111111100": 73,
      "111111110101": 74,
      "111111111000": 7,
      "111111111101": 9,
      "111111111011": 79,
      "111111111010": 17,
      "111111110111": 1
    },
    {
      "size": 13,
      "1111111111111": 0,
      "1111111111100": 72,
      "1111111111101": 8,
      "1111111111110": 80
    }
  ],
  [
    {
      "1000": 30,
      "size": 4,
      "0011": 41,
      "0000": 40,
      "0101": 50,
      "0001": 49,
      "0111": 48,
      "0010": 39,
      "0110": 32,
      "0100": 31
    },
    {
      "100100": 57,
      "100101": 59,
      "100110": 23,
      "100111": 21,
      "101000": 22,
      "101001": 33,
      "101010": 58,
      "101011": 47,
      "101100": 51,
      "101101": 38,
      "101110": 29,
      "101111": 42,
      "110000": 56,
      "110001": 24,
      "110010": 20,
      "110011": 60,
      "size": 6
    },
    {
      "1101000": 14,
      "1101001": 68,
      "1101010": 66,
      "1101011": 34,
      "1101100": 12,
      "1101101": 52,
      "1101110": 46,
      "1101111": 28,
      "1110000": 67,
      "1110001": 13,
      "1110010": 37,
      "1110011": 43,
      "1110100": 69,
      "size": 7
    },
    {
      "11101010": 11,
      "11101011": 25,
      "11101100": 61,
      "11101101": 65,
      "11101110": 55,
      "11101111": 19,
      "11110000": 15,
      "11110001": 70,
      "size": 8
    },
    {
      "111100100": 64,
      "111100101": 10,
      "111100110": 16,
      "111100111": 45,
      "111101000": 27,
      "111101001": 77,
      "111101010": 5,
      "111101011": 3,
      "111101100": 53,
      "111101101": 75,
      "111101110": 35,
      "111101111": 36,
      "111110000": 6,
      "111110001": 2,
      "111110010": 62,
      "111110011": 18,
      "111110100": 4,
      "111110101": 78,
      "111110110": 74,
      "111110111": 26,
      "111111000": 76,
      "111111001": 54,
      "111111010": 44,
      "size": 9
    },
    {
      "1111110110": 9,
      "1111110111": 17,
      "1111111000": 63,
      "1111111001": 73,
      "1111111010": 71,
      "1111111011": 79,
      "1111111100": 7,
      "1111111101": 1,
      "size": 10
    },
    {
      "size": 11,
      "11111111110": 0,
      "11111111111": 72,
      "11111111101": 8,
      "11111111100": 80
    }
  ],
  [
    {
      "0": 0,
      "size": 1
    },
    {
      "100": 8,
      "101": 1,
      "size": 3
    },
    {
      "1100": 9,
      "size": 4
    },
    {
      "110100": 17,
      "110101": 10,
      "110110": 16,
      "110111": 2,
      "size": 6
    },
    {
      "1110000": 25,
      "1110001": 11,
      "1110010": 18,
      "1110011": 24,
      "1110100": 3,
      "size": 7
    },
    {
      "11101010": 19,
      "11101011": 26,
      "11101100": 12,
      "11101101": 33,
      "11101110": 13,
      "11101111": 41,
      "11110000": 27,
      "11110001": 20,
      "11110010": 4,
      "11110011": 32,
      "size": 8
    },
    {
      "111101000": 34,
      "111101001": 21,
      "111101010": 42,
      "111101011": 5,
      "111101100": 49,
      "111101101": 40,
      "111101110": 14,
      "111101111": 35,
      "111110000": 29,
      "111110001": 28,
      "111110010": 43,
      "111110011": 22,
      "111110100": 50,
      "111110101": 15,
      "size": 9
    },
    {
      "1111101100": 30,
      "1111101101": 6,
      "1111101110": 48,
      "1111101111": 36,
      "1111110000": 57,
      "1111110001": 37,
      "1111110010": 58,
      "1111110011": 44,
      "1111110100": 51,
      "1111110101": 23,
      "1111110110": 59,
      "1111110111": 52,
      "1111111000": 45,
      "1111111001": 38,
      "1111111010": 31,
      "size": 10
    },
    {
      "size": 11,
      "11111111011": 39,
      "11111111100": 47,
      "11111111101": 61,
      "11111111010": 60,
      "11111110110": 56,
      "11111111001": 46,
      "11111111000": 53,
      "11111110111": 7
    },
    {
      "size": 12,
      "111111111110": 55,
      "111111111101": 54,
      "111111111100": 62,
      "111111111111": 63
    }
  ],
  [
    {
      "size": 3,
      "000": 9
    },
    {
      "size": 4,
      "0101": 1,
      "0011": 8,
      "0100": 10,
      "0010": 17,
      "0110": 18
    },
    {
      "10000": 2,
      "10001": 25,
      "10010": 11,
      "10011": 26,
      "10100": 19,
      "size": 5,
      "01111": 16,
      "01110": 0
    },
    {
      "101010": 27,
      "101011": 33,
      "101100": 12,
      "101101": 34,
      "101110": 20,
      "101111": 24,
      "110000": 3,
      "110001": 35,
      "110010": 28,
      "110011": 42,
      "size": 6
    },
    {
      "1101000": 41,
      "1101001": 21,
      "1101010": 13,
      "1101011": 43,
      "1101100": 29,
      "1101101": 36,
      "1101110": 44,
      "1101111": 4,
      "1110000": 37,
      "1110001": 32,
      "1110010": 22,
      "1110011": 50,
      "1110100": 49,
      "1110101": 14,
      "size": 7
    },
    {
      "11101100": 30,
      "11101101": 51,
      "11101110": 45,
      "11101111": 40,
      "11110000": 52,
      "11110001": 5,
      "11110010": 38,
      "11110011": 57,
      "11110100": 58,
      "11110101": 23,
      "11110110": 53,
      "11110111": 59,
      "11111000": 15,
      "11111001": 46,
      "11111010": 31,
      "size": 8
    },
    {
      "111110110": 54,
      "111110111": 60,
      "111111000": 48,
      "111111001": 39,
      "111111010": 6,
      "111111011": 61,
      "111111100": 62,
      "111111101": 55,
      "size": 9
    },
    {
      "1111111100": 47,
      "1111111101": 56,
      "1111111110": 7,
      "1111111111": 63,
      "size": 10
    }
  ],
  [
    {
      "0": 0,
      "size": 1
    },
    {
      "100": 13,
      "101": 1,
      "size": 3
    },
    {
      "1100": 14,
      "size": 4
    },
    {
      "110100": 27,
      "110101": 15,
      "110110": 26,
      "110111": 2,
      "size": 6
    },
    {
      "1110000": 40,
      "1110001": 28,
      "1110010": 16,
      "size": 7
    },
    {
      "11100110": 39,
      "11100111": 3,
      "11101000": 29,
      "11101001": 41,
      "11101010": 17,
      "11101011": 53,
      "11101100": 30,
      "11101101": 18,
      "size": 8
    },
    {
      "111011100": 54,
      "111011101": 42,
      "111011110": 4,
      "111011111": 52,
      "111100000": 66,
      "111100001": 31,
      "111100010": 19,
      "111100011": 43,
      "111100100": 67,
      "111100101": 79,
      "111100110": 55,
      "size": 9
    },
    {
      "1111001110": 5,
      "1111001111": 32,
      "1111010000": 65,
      "1111010001": 20,
      "1111010010": 44,
      "1111010011": 21,
      "1111010100": 105,
      "1111010101": 56,
      "1111010110": 68,
      "1111010111": 80,
      "1111011000": 92,
      "1111011001": 6,
      "1111011010": 106,
      "1111011011": 34,
      "1111011100": 45,
      "1111011101": 33,
      "1111011110": 57,
      "1111011111": 118,
      "1111100000": 22,
      "1111100001": 93,
      "size": 10
    },
    {
      "size": 11,
      "11111001100": 46,
      "11111011100": 60,
      "11111000101": 69,
      "11111010001": 70,
      "11111011011": 71,
      "11111100000": 73,
      "11111000100": 78,
      "11111001011": 58,
      "11111011110": 48,
      "11111000110": 81,
      "11111001111": 82,
      "11111011010": 83,
      "11111001010": 47,
      "11111011111": 144,
      "11111010011": 91,
      "11111011101": 59,
      "11111001000": 7,
      "11111010100": 94,
      "11111011001": 95,
      "11111010101": 132,
      "11111001110": 131,
      "11111010010": 104,
      "11111001101": 8,
      "11111010000": 35,
      "11111000111": 107,
      "11111010111": 108,
      "11111100010": 109,
      "11111010110": 120,
      "11111001001": 119,
      "11111100001": 117,
      "11111011000": 23
    },
    {
      "size": 12,
      "111111000111": 36,
      "111111010100": 37,
      "111111001101": 61,
      "111111100010": 62,
      "111111011010": 85,
      "111111100011": 86,
      "111111101001": 87,
      "111111100111": 63,
      "111111101000": 143,
      "111111100001": 135,
      "111111011100": 147,
      "111111100100": 38,
      "111111011000": 49,
      "111111101010": 50,
      "111111001100": 157,
      "111111010011": 96,
      "111111011110": 97,
      "111111010001": 134,
      "111111000110": 133,
      "111111010110": 158,
      "111111001011": 84,
      "111111100000": 130,
      "111111100110": 124,
      "111111001111": 24,
      "111111010010": 72,
      "111111010101": 25,
      "111111011001": 74,
      "111111101011": 75,
      "111111010111": 146,
      "111111001110": 110,
      "111111011011": 111,
      "111111100101": 123,
      "111111010000": 122,
      "111111001010": 121,
      "111111001001": 145,
      "111111001000": 9,
      "111111011101": 10,
      "111111011111": 159
    },
    {
      "size": 13,
      "1111111110100": 115,
      "1111111100110": 88,
      "1111111011000": 112,
      "1111111110110": 103,
      "1111111101011": 125,
      "1111111101111": 126,
      "1111111110001": 102,
      "1111111101010": 101,
      "1111111100010": 100,
      "1111111011001": 99,
      "1111111011101": 98,
      "1111111110111": 90,
      "1111111100000": 136,
      "1111111101000": 137,
      "1111111110000": 138,
      "1111111110011": 89,
      "1111111101110": 113,
      "1111111101001": 77,
      "1111111100011": 76,
      "1111111100001": 64,
      "1111111011100": 148,
      "1111111011111": 149,
      "1111111101101": 150,
      "1111111110101": 151,
      "1111111100111": 156,
      "1111111011011": 51,
      "1111111101100": 12,
      "1111111100100": 11,
      "1111111011110": 160,
      "1111111011010": 161,
      "1111111100101": 162,
      "1111111110010": 163
    },
    {
      "size": 14,
      "11111111111101": 167,
      "11111111111001": 152,
      "11111111111011": 153,
      "11111111111100": 166,
      "11111111110111": 165,
      "11111111110101": 129,
      "11111111110000": 114,
      "11111111110010": 116,
      "11111111110011": 127,
      "11111111110100": 128,
      "11111111110001": 139,
      "11111111111000": 140,
      "11111111110110": 141,
      "11111111111010": 164
    },
    {
      "size": 15,
      "111111111111110": 155,
      "111111111111101": 154,
      "111111111111100": 142,
      "111111111111111": 168
    }
  ],
  [
    {
      "size": 4,
      "0010": 27,
      "0000": 14,
      "0001": 15
    },
    {
      "size": 5,
      "01101": 42,
      "01001": 16,
      "01000": 1,
      "00111": 13,
      "00110": 28,
      "01100": 29,
      "01011": 40,
      "01010": 41
    },
    {
      "100000": 17,
      "100001": 53,
      "100010": 0,
      "100011": 55,
      "100100": 43,
      "100101": 39,
      "100110": 3,
      "100111": 56,
      "101000": 31,
      "101001": 67,
      "size": 6,
      "011110": 30,
      "011101": 2,
      "011100": 26,
      "011111": 54
    },
    {
      "1010100": 18,
      "1010101": 66,
      "1010110": 68,
      "1010111": 44,
      "1011000": 69,
      "1011001": 57,
      "1011010": 80,
      "1011011": 32,
      "1011100": 81,
      "1011101": 52,
      "1011110": 79,
      "1011111": 4,
      "1100000": 19,
      "1100001": 45,
      "1100010": 70,
      "1100011": 82,
      "1100100": 58,
      "size": 7
    },
    {
      "11001010": 83,
      "11001011": 93,
      "11001100": 46,
      "11001101": 33,
      "11001110": 71,
      "11001111": 106,
      "11010000": 94,
      "11010001": 65,
      "11010010": 92,
      "11010011": 5,
      "11010100": 105,
      "11010101": 20,
      "11010110": 107,
      "11010111": 95,
      "11011000": 59,
      "11011001": 34,
      "11011010": 84,
      "11011011": 96,
      "11011100": 21,
      "11011101": 47,
      "11011110": 108,
      "11011111": 60,
      "11100000": 72,
      "11100001": 109,
      "11100010": 73,
      "size": 8
    },
    {
      "111000110": 97,
      "111000111": 85,
      "111001000": 119,
      "111001001": 78,
      "111001010": 86,
      "111001011": 120,
      "111001100": 48,
      "111001101": 118,
      "111001110": 35,
      "111001111": 6,
      "111010000": 110,
      "111010001": 121,
      "111010010": 61,
      "111010011": 132,
      "111010100": 22,
      "111010101": 98,
      "111010110": 111,
      "111010111": 122,
      "111011000": 99,
      "111011001": 133,
      "111011010": 74,
      "111011011": 134,
      "111011100": 36,
      "111011101": 131,
      "111011110": 49,
      "111011111": 123,
      "111100000": 87,
      "111100001": 104,
      "111100010": 62,
      "111100011": 91,
      "111100100": 145,
      "size": 9
    },
    {
      "1111001010": 100,
      "1111001011": 146,
      "1111001100": 136,
      "1111001101": 23,
      "1111001110": 144,
      "1111001111": 124,
      "1111010000": 7,
      "1111010001": 112,
      "1111010010": 135,
      "1111010011": 50,
      "1111010100": 75,
      "1111010101": 113,
      "1111010110": 148,
      "1111010111": 8,
      "1111011000": 147,
      "1111011001": 37,
      "1111011010": 101,
      "1111011011": 88,
      "1111011100": 137,
      "1111011101": 63,
      "1111011110": 24,
      "1111011111": 158,
      "1111100000": 125,
      "1111100001": 159,
      "1111100010": 149,
      "1111100011": 76,
      "1111100100": 160,
      "1111100101": 150,
      "1111100110": 161,
      "1111100111": 51,
      "1111101000": 89,
      "1111101001": 117,
      "1111101010": 138,
      "1111101011": 130,
      "1111101100": 157,
      "1111101101": 9,
      "1111101110": 64,
      "1111101111": 126,
      "1111110000": 162,
      "1111110001": 38,
      "1111110010": 114,
      "size": 10
    },
    {
      "size": 11,
      "11111110111": 154,
      "11111101101": 139,
      "11111111001": 141,
      "11111101111": 164,
      "11111110010": 143,
      "11111101001": 163,
      "11111111000": 128,
      "11111100110": 127,
      "11111111011": 116,
      "11111101110": 115,
      "11111110000": 10,
      "11111110001": 103,
      "11111101000": 151,
      "11111110100": 152,
      "11111110101": 153,
      "11111110011": 140,
      "11111101011": 77,
      "11111111010": 156,
      "11111101010": 102,
      "11111110110": 11,
      "11111100111": 25,
      "11111101100": 90
    },
    {
      "size": 12,
      "111111111101": 12,
      "111111111011": 155,
      "111111111010": 129,
      "111111111001": 142,
      "111111111000": 165,
      "111111111110": 166,
      "111111111100": 167,
      "111111111111": 168
    }
  ],
  [
    {
      "size": 4,
      "0000": 0,
      "0001": 18
    },
    {
      "size": 5,
      "00110": 1,
      "01001": 36,
      "00111": 35,
      "01000": 19,
      "00100": 288,
      "00101": 17
    },
    {
      "size": 6,
      "011010": 54,
      "011001": 2,
      "010100": 20,
      "010110": 53,
      "010111": 34,
      "010101": 52,
      "011000": 37
    },
    {
      "1000000": 39,
      "1000001": 72,
      "1000010": 22,
      "1000011": 88,
      "1000100": 56,
      "1000101": 89,
      "size": 7,
      "0110110": 69,
      "0111001": 38,
      "0111100": 51,
      "0111101": 3,
      "0110111": 21,
      "0111011": 55,
      "0111000": 70,
      "0111010": 71,
      "0111110": 86,
      "0111111": 87
    },
    {
      "10001100": 73,
      "10001101": 104,
      "10001110": 40,
      "10001111": 103,
      "10010000": 105,
      "10010001": 57,
      "10010010": 23,
      "10010011": 84,
      "10010100": 67,
      "10010101": 277,
      "10010110": 275,
      "10010111": 276,
      "10011000": 106,
      "10011001": 278,
      "10011010": 68,
      "10011011": 74,
      "10011100": 4,
      "10011101": 50,
      "10011110": 90,
      "10011111": 101,
      "10100000": 279,
      "10100001": 274,
      "10100010": 280,
      "10100011": 41,
      "10100100": 121,
      "10100101": 58,
      "10100110": 107,
      "10100111": 91,
      "10101000": 118,
      "10101001": 282,
      "10101010": 122,
      "10101011": 120,
      "10101100": 281,
      "10101101": 135,
      "10101110": 33,
      "10101111": 24,
      "10110000": 75,
      "10110001": 283,
      "10110010": 123,
      "10110011": 284,
      "10110100": 152,
      "10110101": 273,
      "10110110": 108,
      "10110111": 169,
      "10111000": 42,
      "10111001": 92,
      "10111010": 186,
      "10111011": 285,
      "10111100": 139,
      "10111101": 138,
      "10111110": 59,
      "10111111": 85,
      "11000000": 286,
      "11000001": 203,
      "11000010": 124,
      "11000011": 76,
      "11000100": 109,
      "11000101": 125,
      "11000110": 5,
      "size": 8
    },
    {
      "110001110": 140,
      "110001111": 287,
      "110010000": 220,
      "110010001": 25,
      "110010010": 137,
      "110010011": 254,
      "110010100": 93,
      "110010101": 237,
      "110010110": 60,
      "110010111": 141,
      "110011000": 126,
      "110011001": 43,
      "110011010": 142,
      "110011011": 155,
      "110011100": 156,
      "110011101": 271,
      "110011110": 77,
      "110011111": 110,
      "110100000": 102,
      "110100001": 157,
      "110100010": 94,
      "110100011": 143,
      "110100100": 127,
      "110100101": 26,
      "110100110": 173,
      "110100111": 6,
      "110101000": 172,
      "110101001": 154,
      "110101010": 158,
      "110101011": 78,
      "110101100": 44,
      "110101101": 159,
      "110101110": 61,
      "110101111": 111,
      "110110000": 174,
      "110110001": 144,
      "110110010": 175,
      "110110011": 160,
      "110110100": 190,
      "110110101": 27,
      "110110110": 119,
      "110110111": 176,
      "110111000": 128,
      "110111001": 62,
      "110111010": 95,
      "110111011": 171,
      "110111100": 79,
      "110111101": 189,
      "110111110": 223,
      "110111111": 112,
      "111000000": 224,
      "111000001": 45,
      "111000010": 272,
      "111000011": 96,
      "111000100": 192,
      "size": 9
    },
    {
      "1110001010": 191,
      "1110001011": 161,
      "1110001100": 129,
      "1110001101": 145,
      "1110001110": 16,
      "1110001111": 81,
      "1110010000": 7,
      "1110010001": 64,
      "1110010010": 193,
      "1110010011": 222,
      "1110010100": 225,
      "1110010101": 207,
      "1110010110": 47,
      "1110010111": 226,
      "1110011000": 146,
      "1110011001": 113,
      "1110011010": 178,
      "1110011011": 177,
      "1110011100": 240,
      "1110011101": 208,
      "1110011110": 28,
      "1110011111": 80,
      "1110100000": 188,
      "1110100001": 63,
      "1110100010": 30,
      "1110100011": 206,
      "1110100100": 130,
      "1110100101": 65,
      "1110100110": 97,
      "1110100111": 98,
      "1110101000": 242,
      "1110101001": 82,
      "1110101010": 194,
      "1110101011": 241,
      "1110101100": 209,
      "1110101101": 227,
      "1110101110": 210,
      "1110101111": 136,
      "1110110000": 195,
      "1110110001": 46,
      "1110110010": 162,
      "1110110011": 243,
      "1110110100": 115,
      "1110110101": 180,
      "1110110110": 257,
      "1110110111": 147,
      "1110111000": 163,
      "1110111001": 244,
      "1110111010": 179,
      "1110111011": 99,
      "1110111100": 196,
      "1110111101": 239,
      "1110111110": 48,
      "1110111111": 114,
      "1111000000": 29,
      "1111000001": 229,
      "1111000010": 8,
      "1111000011": 228,
      "1111000100": 131,
      "1111000101": 211,
      "1111000110": 132,
      "1111000111": 258,
      "1111001000": 205,
      "1111001001": 116,
      "1111001010": 49,
      "1111001011": 260,
      "1111001100": 259,
      "1111001101": 31,
      "1111001110": 164,
      "1111001111": 83,
      "1111010000": 245,
      "1111010001": 149,
      "1111010010": 230,
      "1111010011": 148,
      "1111010100": 100,
      "1111010101": 66,
      "1111010110": 181,
      "1111010111": 197,
      "1111011000": 212,
      "1111011001": 261,
      "1111011010": 262,
      "1111011011": 150,
      "1111011100": 256,
      "1111011101": 133,
      "1111011110": 153,
      "1111011111": 9,
      "1111100000": 166,
      "1111100001": 165,
      "1111100010": 213,
      "1111100011": 246,
      "1111100100": 183,
      "1111100101": 247,
      "1111100110": 214,
      "1111100111": 117,
      "1111101000": 134,
      "size": 10
    },
    {
      "size": 11,
      "11111111000": 238,
      "11111110100": 235,
      "11111101011": 234,
      "11111011111": 233,
      "11111011001": 232,
      "11111011010": 231,
      "11111110010": 221,
      "11111110111": 219,
      "11111100010": 248,
      "11111011110": 249,
      "11111101101": 250,
      "11111110001": 251,
      "11111111001": 252,
      "11111111100": 253,
      "11111101001": 218,
      "11111100110": 10,
      "11111100000": 217,
      "11111100111": 216,
      "11111100100": 215,
      "11111111011": 204,
      "11111110000": 202,
      "11111010101": 201,
      "11111011011": 200,
      "11111010011": 263,
      "11111111010": 236,
      "11111101110": 265,
      "11111101111": 266,
      "11111110101": 267,
      "11111110110": 268,
      "11111110011": 11,
      "11111101100": 13,
      "11111011100": 199,
      "11111010100": 198,
      "11111101000": 187,
      "11111101010": 185,
      "11111011000": 184,
      "11111010111": 182,
      "11111100011": 170,
      "11111100101": 168,
      "11111010010": 167,
      "11111011101": 151,
      "11111010110": 32,
      "11111100001": 264
    },
    {
      "size": 12,
      "111111111110": 15,
      "111111111010": 14,
      "111111111111": 270,
      "111111111011": 12,
      "111111111100": 269,
      "111111111101": 255
    }
  ]
];
